package thread;

public class Demo6 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            while (true){
                System.out.println("Hello t1");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"t1");
        t1.start();
        System.out.println(t1.getPriority());
        /*System.out.println(t1.getId());
        System.out.println(t1.getName());
        System.out.println(t1.getState());*/
        Thread t2=new Thread(()->{
            while (true){
                System.out.println("Hello t2");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"t2");
        t2.start();

        Thread t3=new Thread(()->{
            while (true){
                System.out.println("Hello t3");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"t3");
        t3.start();

        while (true){
            System.out.println("Hello main");
            Thread.sleep(1000);
        }
    }
}
